﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="jsontest.aspx.cs" Inherits="Rmlife.Web.jsontest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Js/JQuery/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        var jsonstr = [{ "objName": "datalist", "objUser": [{ "sUserName": "JSON0", "sAddress": "中国-北京-海淀0号" }, { "sUserName": "JSON1", "sAddress": "中国-北京-海淀1号" }, { "sUserName": "JSON2", "sAddress": "中国-北京-海淀2号" }, { "sUserName": "JSON3", "sAddress": "中国-北京-海淀3号" }, { "sUserName": "JSON4", "sAddress": "中国-北京-海淀4号"}]
        }];

        $(
        function () {

            var obj = eval(jsonstr);
            $.each(obj, function (j, n) {
                $.each(n.objUser, function (i, e) {
                    alert(e.sUserName);
                });
            });
        }
        );
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    </div>
    </form>
</body>
</html>
